When you opened a modem port or a printer port, you sometimes have the message,
"The port is opened." or "The port cannot be opened." or something like that.
That is because your software which used a serial port didn't close the port when it crashed or you typed command-option-esc to escape the deadlock situation.
Maybe the most case you can suffer is the printer port problem.
If you don't connect the printer cable, the Macintosh tries to send control characters to your printer, but it will not communicate with your printer correctly.
That case would give you the problem, "not-closed-port".
So, you should restart your Mac to use the serial port to use any device which is hooked up to the port. ( You may connect the cable correctly and firmly. :) )
That is very ( to me ) intriguing process.
So, I made this tiny program.
This program trys to close the port and succeed it in most case.
As far as I know it works good.
But there may be the case it cannot close a troubled port.
In that case, you should restart your Mac.. ( as far as I know.. :) )
Anyway, I hope this program could be a little help to you.